package model

import (
	"context"
	"service/ctrl"
	"service/model/mod"

	gpb "gitee.com/cloudapex/protos/hr/pb"

	"google.golang.org/grpc"
)

var Posts posts

func init() {
	ctrl.GCon.RegistClienter(mod.GCONN_HR, func(c *grpc.ClientConn) { Posts.cli = gpb.NewPostsClient(c) })
}

type posts struct {
	cli gpb.PostsClient
}

// posts.GetPostList 获取岗位列表
func (this *posts) GetPostList(ctx context.Context, in *gpb.PostBaseReq) (*gpb.GetPostsRes, error) {
	return this.cli.GetPostList(ctx, in)
}

// posts.DelPost 删除岗位
func (this *posts) DelPost(ctx context.Context, in *gpb.PostBaseReq) (*gpb.PostBaseRes, error) {
	return this.cli.DelPost(ctx, in)
}

// posts.AddPost 添加岗位
func (this *posts) AddPost(ctx context.Context, in *gpb.PostBaseReq) (*gpb.PostBaseRes, error) {
	return this.cli.AddPost(ctx, in)
}

// posts.GetPost 获取岗位信息
func (this *posts) GetPost(ctx context.Context, in *gpb.PostBaseReq) (*gpb.PostBaseRes, error) {
	return this.cli.GetPost(ctx, in)
}

// posts.EditPost 修改当前岗位信息
func (this *posts) EditPost(ctx context.Context, in *gpb.PostBaseReq) (*gpb.PostBaseRes, error) {
	return this.cli.EditPost(ctx, in)
}
